// 登录
export const loginRouter = {
  path: '/login',
  name: 'login',
  meta: {
    title: 'Login - 登录'
  },
  component: resolve => {
    require(['@/view/common/login.vue'], resolve)
  }
};

// 404
export const page404 = {
  path: '/*',
  name: 'error-404',
  meta: {
    title: '404 - 页面不存在'
  },
  component: resolve => {
    require(['@/view/common/404.vue'], resolve)
  }
};

// 后台相关路由
export const adminRouter = [{
  path: '/',
  name: 'AdminIndex',
  meta: {
    title: '后台',
    requiresAuth: true
  },
  redirect: '/home',
  component: resolve => {
    require(['@/view/Main.vue'], resolve)
  },
  children: [{
    path: 'home',
    name: 'Home',
    meta: {
      title: '控制台',
      requiresAuth: true
    },
    component: resolve => {
      require(['@/view/home.vue'], resolve)
    }
  },
    {
      path: 'config',
      name: 'System',
      meta: {
        title: '系统设置',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/common/config/save.vue'], resolve)
      }
    },
    {
      path: 'district/save',
      name: 'CommonDistrictSave',
      meta: {
        title: '地区编辑',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/common/district/save.vue'], resolve)
      }
    },
    {
      path: 'district/list',
      name: 'CommonDistrictList',
      meta: {
        title: '省份信息',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/common/district/list-province.vue'], resolve)
      }
    },
    {
      path: 'district/city',
      name: 'CommonDistrictCity',
      meta: {
        title: '城市信息',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/common/district/list-city.vue'], resolve)
      }
    },
    {
      path: 'district/district',
      name: 'CommonDistrictDistrict',
      meta: {
        title: '区县信息',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/common/district/list-district.vue'], resolve)
      }
    },
    {
      path: 'college/list',
      name: 'CommonCollegeList',
      meta: {
        title: '高校信息',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/common/college/list.vue'], resolve)
      }
    },
    {
      path: 'image/list',
      name: 'CommonImageList',
      meta: {
        title: '图片信息',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/common/image/list.vue'], resolve)
      }
    },
    {
      path: 'ucenter/tag/list',
      name: 'UcenterTagList',
      meta: {
        title: '用户标签',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/ucenter/tag/list.vue'], resolve)
      }
    },
    {
      path: 'ucenter/user/info',
      name: 'UcenterUserInfo',
      meta: {
        title: '个人资料',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/ucenter/user/info.vue'], resolve)
      }
    },
    {
      path: 'ucenter/user/list',
      name: 'UcenterUserList',
      meta: {
        title: '用户中心',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/ucenter/user/list.vue'], resolve)
      }
    },
    {
      path: 'ucenter/user/save',
      name: 'UcenterUserSave',
      meta: {
        title: '用户编辑',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/ucenter/user/save.vue'], resolve)
      }
    },
    {
      path: 'ucenter/role/list',
      name: 'UcenterRoleList',
      meta: {
        title: '用户中心',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/ucenter/role/list.vue'], resolve)
      }
    },
    {
      path: 'ucenter/role/save',
      name: 'UcenterRoleSave',
      meta: {
        title: '角色编辑',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/ucenter/role/save.vue'], resolve)
      }
    },
    
    {
      path: 'ucenter/resource/list',
      name: 'UcenterResourceList',
      meta: {
        title: '资源列表',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/ucenter/resource/list.vue'], resolve)
      }
    },
    {
      path: 'ucenter/resource/save',
      name: 'UcenterResourceSave',
      meta: {
        title: '资源编辑',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/ucenter/resource/save.vue'], resolve)
      }
    },
    
    {
      path: 'ucenter/auth/list',
      name: 'UcenterAuthList',
      meta: {
        title: '角色授权',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/ucenter/auth/list.vue'], resolve)
      }
    },
    
    {
      path: 'blog/content/save',
      name: 'BlogContentSave',
      meta: {
        title: '内容编辑',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/blog/content/save.vue'], resolve)
      }
    },
    {
      path: 'blog/content/list',
      name: 'BlogContentList',
      meta: {
        title: '内容列表',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/blog/content/list.vue'], resolve)
      }
    },
    {
      path: 'blog/page/save',
      name: 'BlogPageSave',
      meta: {
        title: '页面编辑',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/blog/page/save.vue'], resolve)
      }
    },
    {
      path: 'blog/page/list',
      name: 'BlogPageList',
      meta: {
        title: '页面列表',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/blog/page/list.vue'], resolve)
      }
    },
    {
      path: 'blog/category/save',
      name: 'BlogCategorySave',
      meta: {
        title: '分类编辑',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/blog/category/save.vue'], resolve)
      }
    },
    {
      path: 'blog/category/list',
      name: 'BlogCategoryList',
      meta: {
        title: '分类列表',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/blog/category/list.vue'], resolve)
      }
    },
    {
      path: 'blog/comment/save',
      name: 'BlogCommentSave',
      meta: {
        title: '分类编辑',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/blog/comment/save.vue'], resolve)
      }
    },
    {
      path: 'blog/comment/list',
      name: 'BlogCommentList',
      meta: {
        title: '分类列表',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/blog/comment/list.vue'], resolve)
      }
    },
    {
      path: 'blog/tag/save',
      name: 'BlogTagSave',
      meta: {
        title: '标签编辑',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/blog/tag/save.vue'], resolve)
      }
    },
    {
      path: 'blog/tag/list',
      name: 'BlogTagList',
      meta: {
        title: '标签列表',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/blog/tag/list.vue'], resolve)
      }
    },
    
    
    {
      path: 'supervision/project/list',
      name: 'SupervisionProjectList',
      meta: {
        title: '工程列表',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/supervision/project/list.vue'], resolve)
      }
    },
    {
      path: 'supervision/project/save',
      name: 'SupervisionProjectSave',
      meta: {
        title: '工程信息编辑',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/supervision/project/save.vue'], resolve)
      }
    },
    
    {
      path: 'supervision/company/list',
      name: 'SupervisionCompanyList',
      meta: {
        title: '公司列表',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/supervision/company/list.vue'], resolve)
      }
    },
    {
      path: 'supervision/company/save',
      name: 'SupervisionCompanySave',
      meta: {
        title: '公司信息',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/supervision/company/save.vue'], resolve)
      }
    },
    
    
    {
      path: 'supervision/plan/list',
      name: 'SupervisionPlanList',
      meta: {
        title: '项目计划列表',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/supervision/plan/list.vue'], resolve)
      }
    },
    {
      path: 'supervision/plan/save',
      name: 'SupervisionPlanSave',
      meta: {
        title: '项目计划',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/supervision/plan/save.vue'], resolve)
      }
    },
    
    
    {
      path: 'supervision/user/list',
      name: 'SupervisionUserList',
      meta: {
        title: '干系人列表',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/supervision/user/list.vue'], resolve)
      }
    },
    {
      path: 'supervision/user/save',
      name: 'SupervisionUserSave',
      meta: {
        title: '干系人',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/supervision/user/save.vue'], resolve)
      }
    },
    
    
    {
      path: 'supervision/log/list',
      name: 'SupervisionLogList',
      meta: {
        title: '项目日志列表',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/supervision/log/list.vue'], resolve)
      }
    },
    {
      path: 'supervision/log/save',
      name: 'SupervisionLogSave',
      meta: {
        title: '项目日志',
        requiresAuth: true
      },
      component: resolve => {
        require(['@/view/supervision/log/save.vue'], resolve)
      }
    },
  
  
  ]
}];

// 所有上面定义的路由全部写在一起
export const routers = [
  loginRouter,
  ...adminRouter,
  page404
];
